package com.sc.study.sleeproom.mapper;

import java.util.List;
import com.sc.study.sleeproom.domain.ScSleepRoom;
import org.apache.ibatis.annotations.Param;

/**
 * 寝室Mapper接口
 * 
 * @author sc
 * @date 2022-03-14
 */
public interface ScSleepRoomMapper 
{
    /**
     * 查询寝室
     * 
     * @param id 寝室主键
     * @return 寝室
     */
    public ScSleepRoom selectScSleepRoomById(Long id);

    /**
     * 根据查询条件查询寝室列表的第一个
     * @param sleepRoomPersonTypeId 寝室类型
     * @param personId 人员编号
     * @return 寝室集合
     */
    public ScSleepRoom selectScSleepRoomJoinPerson(@Param("sleepRoomPersonTypeId") String sleepRoomPersonTypeId, @Param("personId") Integer personId);



    /**
     * 查询寝室列表
     * 
     * @param scSleepRoom 寝室
     * @return 寝室集合
     */
    public List<ScSleepRoom> selectScSleepRoomList(ScSleepRoom scSleepRoom);

    /**
     * 新增寝室
     * 
     * @param scSleepRoom 寝室
     * @return 结果
     */
    public int insertScSleepRoom(ScSleepRoom scSleepRoom);

    /**
     * 修改寝室
     * 
     * @param scSleepRoom 寝室
     * @return 结果
     */
    public int updateScSleepRoom(ScSleepRoom scSleepRoom);

    /**
     * 删除寝室
     * 
     * @param id 寝室主键
     * @return 结果
     */
    public int deleteScSleepRoomById(Long id);

    /**
     * 批量删除寝室
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteScSleepRoomByIds(Long[] ids);

    /**
     * 获取当前班级 管理的寝室
     * @param clazzId
     * @param sex
     */
    List<ScSleepRoom> getClazzForRooms(@Param("clazzId") Integer clazzId,@Param("sex") String sex, @Param("personTypes") List<Long> personTypes);

    /**
     * 查询所有寝室不分页
     * @param sleepRoomName   栋 + 层 + 名称 模糊查询
     * @param sex
     * @return
     */
    List<ScSleepRoom> getSleepRoomList(@Param("sleepRoomName") String sleepRoomName, @Param("sex") String sex);
}
